package cn.itcast.assertCode;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
// 通过校验码 验证注册信息是否有效
public class RegisterServlet extends HttpServlet {

	@SuppressWarnings("static-access")
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {



		request.setCharacterEncoding("UTF-8");




		response.setContentType("text/html;charset=UTF-8");


		String c_checkcode = request.getParameter("chackcode");

		String s_checkcode = (String) request.getSession().getAttribute("chackcode");


		if (c_checkcode.equals(s_checkcode) && c_checkcode!=null&&s_checkcode!=null) {

			System.out.println("处理注册信息请求");
		}else {
			System.out.println("认证码错误");
		}

	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doGet(request, response);
		response.setContentType("text/html;charset=UTF-8");

	}

}
